package com.jucStudy.erweimaStudy.controller;

import com.jucStudy.common.util.QrCodeUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
public class QrCodeController {

    @GetMapping(value = "/qrcode")
    public void Qrcode(@RequestParam("code")String code, HttpServletRequest request, HttpServletResponse response){

        try {
            QrCodeUtils.createCodeToOutputStream(code,500,300,response.getOutputStream());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
